//
//  YFHeader.h
//  TechandForPartner
//
//  Created by Yutian Duan on 16/7/23.
//  Copyright © 2016年 techand. All rights reserved.
//

#ifndef YFHeader_h
#define YFHeader_h

#pragma mark - static inline methods

/**
 Inserting `` objects into an NSDictionary
 
 @param object
 */
static inline id ObjectOrBlank(id object) {
  return object ? object : @"";
}

#ifndef HEIGHT_IPHONE_5
#define HEIGHT_IPHONE_5     568
#endif

#ifndef IS_IPHONE
#define IS_IPHONE           ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
#endif

#ifndef IS_IPHONE5
#define IS_IPHONE5          (([[UIScreen mainScreen] bounds].size.height - HEIGHT_IPHONE_5) ? NO : YES)
#endif

#ifndef ScreenSize
#define ScreenSize [[UIScreen mainScreen] bounds]
#endif

#ifndef ScreenWidth
#define ScreenWidth [[UIScreen mainScreen] bounds].size.width
#endif

#ifndef ScreenHeight
#define ScreenHeight [[UIScreen mainScreen] bounds].size.height
#endif


// 获取Size中的较大值
#define MAX_LENGTH(size) (size.width > size.height ? size.width : size.height)
// 判断当前设备是否是刘海屏，不只是iPhone X
#define iPhoneXSize ((NSInteger)MAX_LENGTH([UIScreen mainScreen].bounds.size) >= 812)




#define TabBarHeight       (iPhoneXSize ? (49 + 34) : 49)

//！ 状态栏高度 20 or 44
#define StatusBarHeight    [UIApplication sharedApplication].statusBarFrame.size.height

#define NavBarHeight (44.0+StatusBarHeight)

///--------------------------------
/// @name THLog
///--------------------------------

#ifdef DEBUG
/* THLog */
#ifndef THLog
#define THLog(FORMAT, ...) fprintf(stderr, "%s Line:%d\t\n%s\n\n", [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#endif
/* NSLog */
#ifndef NSLog
#define NSLog(FORMAT, ...) fprintf(stderr, "%s Line:%d\t\n%s\n\n", [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#endif
#else
#ifndef THLog
#define THLog(FORMAT, ...) nil
#endif
#ifndef NSLog
#define NSLog(FORMAT, ...) nil
#endif
#endif



///! item 的比例
#define  ITEMPRO 0.45
//!
#define  IMAGEPRO 0.32

///--------------------------------
/// @name Import Header
///--------------------------------



#import "YFColorDef.h"
#import "AppUser.h"
#import "YTCategory.h"
#import "ToolsServer.h"
#import "Base_App-Swift.h"
#import "YFThirdData.h"
#import "UIButton+WWDeal.h"
#import "Tools.h"

#endif /* YFHeader_h */
